<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Sifteo SDK: color.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-style-overrides.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<center>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Sifteo SDK" src="sdk_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">v1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</center>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="pages.html"><span>Guides</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_12cda917fe1d7c8b4e7d2501bb3636e4.html">sdk</a></li><li class="navelem"><a class="el" href="dir_2f23e30b638d6a5f333babd9a5d183e1.html">include</a></li><li class="navelem"><a class="el" href="dir_d5ace589187da7c83c1a7507ec9fbbef.html">sifteo</a></li><li class="navelem"><a class="el" href="dir_483499650334b406c1d3bbaf3a730f60.html">video</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">color.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* -*- mode: C; c-basic-offset: 4; intent-tabs-mode: nil -*-</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * This file is part of the public interface to the Sifteo SDK.</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright &lt;c&gt; 2012 Sifteo, Inc. All rights reserved.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#ifdef NOT_USERSPACE</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#   error This is a userspace-only header, not allowed by the current build.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;sifteo/abi.h&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;sifteo/macros.h&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;sifteo/math.h&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="keyword">namespace </span>Sifteo {</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html">   31</a></span>&#160;<span class="keyword">struct </span><a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> {</div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html#aab28724ae443519720a500a30bc06e34">   33</a></span>&#160;    uint16_t <a class="code" href="struct_sifteo_1_1_r_g_b565.html#aab28724ae443519720a500a30bc06e34" title="The raw color value, as a 16-bit integer.">value</a>;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html#ac537f5470df2f336f298289d1e6b1ed7">   39</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#ac537f5470df2f336f298289d1e6b1ed7" title="Create an RGB565 color from a 5-6-5-bit RGB color, with each component specified separately.">from565</a>(uint8_t r, uint8_t g, uint8_t b) {</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;        <a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> result = { (r &lt;&lt; 11) | (g &lt;&lt; 5) | b };</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;        <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    }</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html#a729d621f56b7a610e864caf180778aff">   48</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#a729d621f56b7a610e864caf180778aff" title="Create an RGB565 color from an 8-bit RGB color. We accurately round to the nearest representable 16-b...">fromRGB</a>(uint8_t r, uint8_t g, uint8_t b) {</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="comment">         * Round to the nearest 5/6 bit color. Note that simple</span></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="comment">         * bit truncation does NOT produce the best result!</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#ac537f5470df2f336f298289d1e6b1ed7" title="Create an RGB565 color from a 5-6-5-bit RGB color, with each component specified separately.">from565</a>( ((<span class="keywordtype">unsigned</span>)r * 31 + 128) / 255,</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;                        ((<span class="keywordtype">unsigned</span>)g * 63 + 128) / 255,</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;                        ((<span class="keywordtype">unsigned</span>)b * 31 + 128) / 255 );</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    }</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html#a6e53b6315b19e464ac9622291aaa849e">   62</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#a6e53b6315b19e464ac9622291aaa849e" title="Create an RGB565 color from a floating point RGB color. We accurately round to the nearest representa...">fromRGB</a>(<span class="keywordtype">float</span> r, <span class="keywordtype">float</span> g, <span class="keywordtype">float</span> b) {</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#ac537f5470df2f336f298289d1e6b1ed7" title="Create an RGB565 color from a 5-6-5-bit RGB color, with each component specified separately.">from565</a>( r * 31.f + 0.5f,</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;                        g * 63.f + 0.5f,</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;                        b * 31.f + 0.5f );</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    }</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div>
<div class="line"><a name="l00074"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html#aecefb503f12bb4a3fef22cfb9d135616">   74</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#aecefb503f12bb4a3fef22cfb9d135616" title="Create an RGB565 color from a packed-pixel 24-bit RGB color.">fromRGB</a>(uint32_t rgb) {</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#a729d621f56b7a610e864caf180778aff" title="Create an RGB565 color from an 8-bit RGB color. We accurately round to the nearest representable 16-b...">fromRGB</a>((uint8_t)(rgb &gt;&gt; 16), (uint8_t)(rgb &gt;&gt; 8), (uint8_t)rgb);</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    }</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html#aa4f2bf1537970663216f288a7ee5f869">   81</a></span>&#160;    uint8_t <a class="code" href="struct_sifteo_1_1_r_g_b565.html#aa4f2bf1537970663216f288a7ee5f869" title="Return the color&#39;s red component, as a 5-bit value.">red5</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        <span class="keywordflow">return</span> (<a class="code" href="struct_sifteo_1_1_r_g_b565.html#aab28724ae443519720a500a30bc06e34" title="The raw color value, as a 16-bit integer.">value</a> &gt;&gt; 11) &amp; 0x1F;</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    }</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div>
<div class="line"><a name="l00088"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html#aded38b2824696652e9af786deecc673c">   88</a></span>&#160;    uint8_t <a class="code" href="struct_sifteo_1_1_r_g_b565.html#aded38b2824696652e9af786deecc673c" title="Return the color&#39;s green component, as a 6-bit value.">green6</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        <span class="keywordflow">return</span> (<a class="code" href="struct_sifteo_1_1_r_g_b565.html#aab28724ae443519720a500a30bc06e34" title="The raw color value, as a 16-bit integer.">value</a> &gt;&gt; 5) &amp; 0x3F;</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    }</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html#ab15a795fe7fb6018492ffed77c718616">   95</a></span>&#160;    uint8_t <a class="code" href="struct_sifteo_1_1_r_g_b565.html#ab15a795fe7fb6018492ffed77c718616" title="Return the color&#39;s blue component, as a 5-bit value.">blue5</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#aab28724ae443519720a500a30bc06e34" title="The raw color value, as a 16-bit integer.">value</a> &amp; 0x1F;</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    }</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html#acae33d5b3e9e12e5e3eacbe9855be163">  102</a></span>&#160;    uint8_t <a class="code" href="struct_sifteo_1_1_r_g_b565.html#acae33d5b3e9e12e5e3eacbe9855be163" title="Return the color&#39;s red component, extended to 8 bits.">red</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="comment">         * A good approximation is `(r5 &lt;&lt; 3) | (r5 &gt;&gt; 2)`, but this</span></div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="comment">         * is still not quite as accurate as the implementation here.</span></div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#aa4f2bf1537970663216f288a7ee5f869" title="Return the color&#39;s red component, as a 5-bit value.">red5</a>() * 255 / 31;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    }</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div>
<div class="line"><a name="l00113"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html#a398146a00d4efe894a727b08da14dd07">  113</a></span>&#160;    uint8_t <a class="code" href="struct_sifteo_1_1_r_g_b565.html#a398146a00d4efe894a727b08da14dd07" title="Return the color&#39;s green component, extended to 8 bits.">green</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#aded38b2824696652e9af786deecc673c" title="Return the color&#39;s green component, as a 6-bit value.">green6</a>() * 255 / 63;</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    }</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div>
<div class="line"><a name="l00120"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html#a5785cfa9dc98d437a94e3a61c6d6c17f">  120</a></span>&#160;    uint8_t <a class="code" href="struct_sifteo_1_1_r_g_b565.html#a5785cfa9dc98d437a94e3a61c6d6c17f" title="Return the color&#39;s blue component, extended to 8 bits.">blue</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#ab15a795fe7fb6018492ffed77c718616" title="Return the color&#39;s blue component, as a 5-bit value.">blue5</a>() * 255 / 31;</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    }</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html#a452d19f7e4a053994e4cb0f1f88b49f5">  130</a></span>&#160;    uint32_t <a class="code" href="struct_sifteo_1_1_r_g_b565.html#a452d19f7e4a053994e4cb0f1f88b49f5" title="Return the color as a packed 24-bit RGB value.">packedRGB</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#a5785cfa9dc98d437a94e3a61c6d6c17f" title="Return the color&#39;s blue component, extended to 8 bits.">blue</a>() | (<a class="code" href="struct_sifteo_1_1_r_g_b565.html#a398146a00d4efe894a727b08da14dd07" title="Return the color&#39;s green component, extended to 8 bits.">green</a>() &lt;&lt; 8) | (<a class="code" href="struct_sifteo_1_1_r_g_b565.html#acae33d5b3e9e12e5e3eacbe9855be163" title="Return the color&#39;s red component, extended to 8 bits.">red</a>() &lt;&lt; 16);</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    }</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    </div>
<div class="line"><a name="l00141"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html#a900c52657df0fc33b53c2329287de642">  141</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#a900c52657df0fc33b53c2329287de642" title="Linear interpolation between this color and another color.">lerp</a>(<a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> other, uint8_t alpha)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;        <span class="keywordtype">unsigned</span> A = alpha;</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;        <span class="keywordtype">unsigned</span> invA = 0xff - A;</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#ac537f5470df2f336f298289d1e6b1ed7" title="Create an RGB565 color from a 5-6-5-bit RGB color, with each component specified separately.">from565</a>( (<a class="code" href="struct_sifteo_1_1_r_g_b565.html#aa4f2bf1537970663216f288a7ee5f869" title="Return the color&#39;s red component, as a 5-bit value.">red5</a>()   * invA + other.<a class="code" href="struct_sifteo_1_1_r_g_b565.html#aa4f2bf1537970663216f288a7ee5f869" title="Return the color&#39;s red component, as a 5-bit value.">red5</a>()   * A) / 0xff,</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;                        (<a class="code" href="struct_sifteo_1_1_r_g_b565.html#aded38b2824696652e9af786deecc673c" title="Return the color&#39;s green component, as a 6-bit value.">green6</a>() * invA + other.<a class="code" href="struct_sifteo_1_1_r_g_b565.html#aded38b2824696652e9af786deecc673c" title="Return the color&#39;s green component, as a 6-bit value.">green6</a>() * A) / 0xff,</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;                        (<a class="code" href="struct_sifteo_1_1_r_g_b565.html#ab15a795fe7fb6018492ffed77c718616" title="Return the color&#39;s blue component, as a 5-bit value.">blue5</a>()  * invA + other.<a class="code" href="struct_sifteo_1_1_r_g_b565.html#ab15a795fe7fb6018492ffed77c718616" title="Return the color&#39;s blue component, as a 5-bit value.">blue5</a>()  * A) / 0xff );</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    }</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div>
<div class="line"><a name="l00150"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html#a5c51313d6e99caf15698e7733c777cc9">  150</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#a5c51313d6e99caf15698e7733c777cc9" title="Exact equality test.">operator== </a>(<span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> &amp;other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#aab28724ae443519720a500a30bc06e34" title="The raw color value, as a 16-bit integer.">value</a> == other.<a class="code" href="struct_sifteo_1_1_r_g_b565.html#aab28724ae443519720a500a30bc06e34" title="The raw color value, as a 16-bit integer.">value</a>; }</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div>
<div class="line"><a name="l00153"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_r_g_b565.html#a80c0c9d0ae95fa9aa15a0bd9c5855b73">  153</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#a80c0c9d0ae95fa9aa15a0bd9c5855b73" title="Exact inequality test.">operator!= </a>(<span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> &amp;other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html#aab28724ae443519720a500a30bc06e34" title="The raw color value, as a 16-bit integer.">value</a> != other.<a class="code" href="struct_sifteo_1_1_r_g_b565.html#aab28724ae443519720a500a30bc06e34" title="The raw color value, as a 16-bit integer.">value</a>; }</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;};</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div>
<div class="line"><a name="l00168"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap_slot.html">  168</a></span>&#160;<span class="keyword">struct </span><a class="code" href="struct_sifteo_1_1_colormap_slot.html" title="A ColormapSlot refers to a single colormap index on a single cube.">ColormapSlot</a> {</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    _SYSAttachedVideoBuffer *sys;</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="keywordtype">unsigned</span> index;</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;</div>
<div class="line"><a name="l00175"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap_slot.html#ad1709ffc620c1d5a8eb17fe453a41581">  175</a></span>&#160;    <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> color) <span class="keyword">const</span> {</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;        _SYS_vbuf_poke(&amp;sys-&gt;vbuf, _SYS_VA_COLORMAP / 2 + index, color.value);</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    }</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;</div>
<div class="line"><a name="l00182"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap_slot.html#a84642938eb2973ac3cdf5cf6258186cc">  182</a></span>&#160;    <span class="keywordtype">void</span> <span class="keyword">set</span>(uint8_t r, uint8_t g, uint8_t b) <span class="keyword">const</span> {</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;        <span class="keyword">set</span>(<a class="code" href="struct_sifteo_1_1_r_g_b565.html#a729d621f56b7a610e864caf180778aff" title="Create an RGB565 color from an 8-bit RGB color. We accurately round to the nearest representable 16-b...">RGB565::fromRGB</a>(r, g, b));</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    }</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div>
<div class="line"><a name="l00189"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap_slot.html#aecef90d61c94ee78dde013570d081a37">  189</a></span>&#160;    <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">float</span> r, <span class="keywordtype">float</span> g, <span class="keywordtype">float</span> b) <span class="keyword">const</span> {</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        <span class="keyword">set</span>(<a class="code" href="struct_sifteo_1_1_r_g_b565.html#a729d621f56b7a610e864caf180778aff" title="Create an RGB565 color from an 8-bit RGB color. We accurately round to the nearest representable 16-b...">RGB565::fromRGB</a>(r, g, b));</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    }</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;</div>
<div class="line"><a name="l00199"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap_slot.html#a1585ce87998e21358205959ad52af814">  199</a></span>&#160;    <span class="keywordtype">void</span> <span class="keyword">set</span>(uint32_t rgb) <span class="keyword">const</span> {</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;        <span class="keyword">set</span>(<a class="code" href="struct_sifteo_1_1_r_g_b565.html#a729d621f56b7a610e864caf180778aff" title="Create an RGB565 color from an 8-bit RGB color. We accurately round to the nearest representable 16-b...">RGB565::fromRGB</a>(rgb));</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    }</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;</div>
<div class="line"><a name="l00206"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap_slot.html#a8db80fe7c4b6b34503b1b441d7adec24">  206</a></span>&#160;    <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_colormap_slot.html" title="A ColormapSlot refers to a single colormap index on a single cube.">ColormapSlot</a>&amp; <a class="code" href="struct_sifteo_1_1_colormap_slot.html#a8db80fe7c4b6b34503b1b441d7adec24" title="Set the color in this slot to a specifc RGB565 value.">operator= </a>(<a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> color)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;        <span class="keyword">set</span>(color);</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;        <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    }</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;</div>
<div class="line"><a name="l00217"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap_slot.html#a29470a6173a3fb70fdcb8be00cae4034">  217</a></span>&#160;    <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_colormap_slot.html" title="A ColormapSlot refers to a single colormap index on a single cube.">ColormapSlot</a>&amp; <a class="code" href="struct_sifteo_1_1_colormap_slot.html#a8db80fe7c4b6b34503b1b441d7adec24" title="Set the color in this slot to a specifc RGB565 value.">operator= </a>(uint32_t color)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;        <span class="keyword">set</span>(color);</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;        <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    }</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;</div>
<div class="line"><a name="l00225"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap_slot.html#aae96f7b4f513bc7532a38b8054f22215">  225</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> <span class="keyword">get</span>() <span class="keyword">const</span> {</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;        <a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> result = { _SYS_vbuf_peek(&amp;sys-&gt;vbuf, _SYS_VA_COLORMAP / 2 + index) };</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    }</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;};</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;</div>
<div class="line"><a name="l00245"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap.html">  245</a></span>&#160;<span class="keyword">struct </span><a class="code" href="struct_sifteo_1_1_colormap.html" title="An accessor for the colormap, with up to 16 colors.">Colormap</a> {</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;    _SYSAttachedVideoBuffer sys;</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;</div>
<div class="line"><a name="l00249"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap.html#afafcb0570a05cffb1d6bb332fc486830">  249</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <a class="code" href="struct_sifteo_1_1_colormap.html#afafcb0570a05cffb1d6bb332fc486830" title="Maximum number of colors in the colormap.">NUM_COLORS</a> = 16;</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;</div>
<div class="line"><a name="l00259"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap.html#acacffa36ca71f5ca1f59bfbc3aadc5be">  259</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_colormap_slot.html" title="A ColormapSlot refers to a single colormap index on a single cube.">ColormapSlot</a> <a class="code" href="struct_sifteo_1_1_colormap.html#acacffa36ca71f5ca1f59bfbc3aadc5be" title="Return a ColormapSlot which references a single colormap entry on a single VideoBuffer.">operator[]</a>(<span class="keywordtype">unsigned</span> index) {</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(index &lt; <a class="code" href="struct_sifteo_1_1_colormap.html#afafcb0570a05cffb1d6bb332fc486830" title="Maximum number of colors in the colormap.">NUM_COLORS</a>);</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;        <a class="code" href="struct_sifteo_1_1_colormap_slot.html" title="A ColormapSlot refers to a single colormap index on a single cube.">ColormapSlot</a> result = { &amp;sys, index };</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;        <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;    }</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;</div>
<div class="line"><a name="l00268"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap.html#a3cb51e19311327f79400a846f39abc7e">  268</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_colormap.html#a3cb51e19311327f79400a846f39abc7e" title="Clear the palette to black.">erase</a>() {</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;        _SYS_vbuf_fill(&amp;sys.vbuf, _SYS_VA_COLORMAP / 2, 0, <a class="code" href="struct_sifteo_1_1_colormap.html#afafcb0570a05cffb1d6bb332fc486830" title="Maximum number of colors in the colormap.">NUM_COLORS</a>);</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    }</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;</div>
<div class="line"><a name="l00275"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap.html#ac9736ed9c94b30efd46aba1624405d9e">  275</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_colormap.html#ac9736ed9c94b30efd46aba1624405d9e" title="Splat the given color across all colormap slots.">fill</a>(<a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> color) {</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;        _SYS_vbuf_fill(&amp;sys.vbuf, _SYS_VA_COLORMAP / 2, color.<a class="code" href="struct_sifteo_1_1_r_g_b565.html#aab28724ae443519720a500a30bc06e34" title="The raw color value, as a 16-bit integer.">value</a>, <a class="code" href="struct_sifteo_1_1_colormap.html#afafcb0570a05cffb1d6bb332fc486830" title="Maximum number of colors in the colormap.">NUM_COLORS</a>);</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;    }</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;</div>
<div class="line"><a name="l00282"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap.html#afcea0572668aa6e9a6fe103c6ed40357">  282</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_colormap.html#afcea0572668aa6e9a6fe103c6ed40357" title="Set a range of colormap values, given an array of RGB565 values.">setRange</a>(<span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> *colors, <span class="keywordtype">unsigned</span> firstColor, <span class="keywordtype">unsigned</span> numColors) {</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(firstColor &lt;= <a class="code" href="struct_sifteo_1_1_colormap.html#afafcb0570a05cffb1d6bb332fc486830" title="Maximum number of colors in the colormap.">NUM_COLORS</a> &amp;&amp; numColors &lt;= <a class="code" href="struct_sifteo_1_1_colormap.html#afafcb0570a05cffb1d6bb332fc486830" title="Maximum number of colors in the colormap.">NUM_COLORS</a></div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;            &amp;&amp; (firstColor + numColors) &lt;= <a class="code" href="struct_sifteo_1_1_colormap.html#afafcb0570a05cffb1d6bb332fc486830" title="Maximum number of colors in the colormap.">NUM_COLORS</a>);</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;        _SYS_vbuf_write(&amp;sys.vbuf, _SYS_VA_COLORMAP / 2 + firstColor,</div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;            &amp;colors[0].<a class="code" href="struct_sifteo_1_1_r_g_b565.html#aab28724ae443519720a500a30bc06e34" title="The raw color value, as a 16-bit integer.">value</a>, numColors);</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    }</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;</div>
<div class="line"><a name="l00292"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap.html#a7eb563edf7aed6010e5015ee0adf5d8c">  292</a></span>&#160;    <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> *colors) {</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;        <a class="code" href="struct_sifteo_1_1_colormap.html#afcea0572668aa6e9a6fe103c6ed40357" title="Set a range of colormap values, given an array of RGB565 values.">setRange</a>(colors, 0, <a class="code" href="struct_sifteo_1_1_colormap.html#afafcb0570a05cffb1d6bb332fc486830" title="Maximum number of colors in the colormap.">NUM_COLORS</a>);</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;    }</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;</div>
<div class="line"><a name="l00301"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap.html#a3262a55bf13333943c351666047c59ff">  301</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_colormap.html#a3262a55bf13333943c351666047c59ff" title="Set the entire palette to the traditional EGA 16-color palette.">setEGA</a>() {</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;        <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> colors[] = {</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;            <span class="comment">/*  0 */</span> { 0x0000 },</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;            <span class="comment">/*  1 */</span> { 0x0015 },</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;            <span class="comment">/*  2 */</span> { 0x0540 },</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;            <span class="comment">/*  3 */</span> { 0x0555 },</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;            <span class="comment">/*  4 */</span> { 0xa800 },</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;            <span class="comment">/*  5 */</span> { 0xa815 },</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;            <span class="comment">/*  6 */</span> { 0xaaa0 },</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;            <span class="comment">/*  7 */</span> { 0xad55 },</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;            <span class="comment">/*  8 */</span> { 0x52aa },</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;            <span class="comment">/*  9 */</span> { 0x52bf },</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;            <span class="comment">/* 10 */</span> { 0x57ea },</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;            <span class="comment">/* 11 */</span> { 0x57ff },</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;            <span class="comment">/* 12 */</span> { 0xfaaa },</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;            <span class="comment">/* 13 */</span> { 0xfabf },</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;            <span class="comment">/* 14 */</span> { 0xffea },</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;            <span class="comment">/* 15 */</span> { 0xffff },</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;        };</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;        <span class="keyword">set</span>(colors);</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;    }</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;</div>
<div class="line"><a name="l00328"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap.html#a527a390a255a81a50ce23662ae7c011c">  328</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_colormap.html#a527a390a255a81a50ce23662ae7c011c" title="Set a monochrome palette, in entries [0] and [1].">setMono</a>(<a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> color0, <a class="code" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> color1) {</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;        (*this)[0].set(color0);</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;        (*this)[1].set(color1);</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;    }</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;</div>
<div class="line"><a name="l00340"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap.html#a94dd30283795b4fa6635d3e8c364ca4a">  340</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_colormap.html#a94dd30283795b4fa6635d3e8c364ca4a" title="Set a monochrome palette, in entries [0] and [1].">setMono</a>(uint32_t color0, uint32_t color1) {</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;        (*this)[0].set(color0);</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;        (*this)[1].set(color1);</div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;    }</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;</div>
<div class="line"><a name="l00348"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap.html#a931de7625a820b0b422b465806aca9a8">  348</a></span>&#160;    _SYSVideoBuffer &amp;<a class="code" href="struct_sifteo_1_1_colormap.html#a931de7625a820b0b422b465806aca9a8" title="Return the VideoBuffer associated with this drawable.">videoBuffer</a>() {</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;        <span class="keywordflow">return</span> sys.vbuf;</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;    }</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;</div>
<div class="line"><a name="l00355"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_colormap.html#ac7c79efa7d94c0e78e71554963c5c06f">  355</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_cube_i_d.html" title="A lightweight identifier for one Sifteo cube.">CubeID</a> <a class="code" href="struct_sifteo_1_1_colormap.html#ac7c79efa7d94c0e78e71554963c5c06f" title="Return the CubeID associated with this drawable.">cube</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;        <span class="keywordflow">return</span> sys.cube;</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;    }</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;};</div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;};  <span class="comment">// namespace Sifteo</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
    <hr class="footer"/>
    <address class="footer">
        <p><a href="http://sifteo.com">Sifteo</a> SDK v1.0.0 <small>(see <a href="https://developers.sifteo.com/sifteosdk">all versions</a>)</small></p>
        <p>Last updated Wed Mar 27 2013, by <a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a></p>
    </address>
</body>
</html>
